/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.crm.action.sale;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.crm.mapper.sale.SubsidiaryInfoMapper;
public class SubsidiaryInfo extends BaseAction
{
    @Autowired(required=false)
	private SubsidiaryInfoMapper mapper;
    /**
    附属信息
    */
    
    public Map subsidiaryInfo() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_client_cert=mapper.s_client_cert(params);
        result.put("s_client_cert", s_client_cert);
        
        
        SQLList<SQLMap> s_file_version=mapper.s_file_version(params);
        result.put("s_file_version", s_file_version);
        
        
        SQLList<SQLMap> s_quality=mapper.s_quality(params);
        result.put("s_quality", s_quality);
        
        
        SQLList<SQLMap> s_bank_account=mapper.s_bank_account(params);
        result.put("s_bank_account", s_bank_account);
        
        return result;
    }
    /**
    修改证书
    */
    
    public Map certificateUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_client_cert=mapper.s_client_cert(params);
        SQLMap s_client_cert_emt=s_client_cert.getExistfirst();
        result.put("s_client_cert", s_client_cert_emt);
        
        return result;
    }
    /**
    证书明细
    */
    
    public Map certificateDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_client_cert=mapper.s_client_cert(params);
        SQLMap s_client_cert_emt=s_client_cert.getExistfirst();
        result.put("s_client_cert", s_client_cert_emt);
        
        return result;
    }
    /**
    修改资质
    */
    
    public Map qualificationsUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_quality=mapper.s_quality(params);
        SQLMap s_quality_emt=s_quality.getExistfirst();
        result.put("s_quality", s_quality_emt);
        
        return result;
    }
    /**
    修改银行账户
    */
    
    public Map bankAccountUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_bank_account=mapper.s_bank_account(params);
        SQLMap s_bank_account_emt=s_bank_account.getExistfirst();
        result.put("s_bank_account", s_bank_account_emt);
        
        return result;
    }
    /**
    添加任务提醒
    */
    
    public Map addTaskReminders() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_1=mapper.s_1(params);
        SQLMap s_1_emt=s_1.getExistfirst();
        result.put("s_1", s_1_emt);
        
        
        SQLList<SQLMap> t_title=mapper.t_title(params);
        SQLMap t_title_emt=t_title.getExistfirst();
        result.put("t_title", t_title_emt);
        
        return result;
    }
    /**
    选择公司人员
    */
    
    public Map selectionPersonnelAut() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        
        
        SQLList<SQLMap> person_info=mapper.person_info(params,pagination);
        person_info.setPagedListInfo(pagination);
        result.put("person_info", person_info);
        
        return result;
    }
    /**
    */
    
    public Map d_quality() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_quality(params);
        
        return result;
    }
    /**
    */
    
    public Map d_bank_account() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_bank_account(params);
        
        return result;
    }
    /**
    修改证书修改
    */
    
    public Map certificateUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.certificateUpSubmit(params);
        
        return result;
    }
    /**
    增加证书修改
    */
    
    public Map certificateAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMID1 = mapper.CMID1(params);
        result.put("CMID1", CMID1);
        
        return result;
    }
    /**
    增加资质修改
    */
    
    public Map qualificationsAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        params.def("fileid",null);
        int i_client_quality = mapper.i_client_quality(params);
        result.put("i_client_quality", i_client_quality);
        
        return result;
    }
    /**
    修改资质修改
    */
    
    public Map qualificationsUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        params.def("fileid",-1);
        mapper.qualificationsUpSubmit(params);
        
        return result;
    }
    /**
    增加银行账户修改
    */
    
    public Map bankAccountAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_bank_account = mapper.i_bank_account(params);
        result.put("i_bank_account", i_bank_account);
        
        return result;
    }
    /**
    修改银行账户修改
    */
    
    public Map bankAccountUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_bank_account = mapper.i_bank_account(params);
        result.put("i_bank_account", i_bank_account);
        
        return result;
    }
    /**
    */
    
    public Map set_title() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.set_title(params);
        
        return result;
    }
    /**
    */
    
    public Map i_title() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int title_id = mapper.title_id(params);
        result.put("title_id", title_id);
        
        
        int task_id = mapper.task_id(params);
        result.put("task_id", task_id);
        
        
        mapper.i_title(params);
        
        
        
        return result;
    }
    /**
    */
    
    public Map updatetime() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_user=mapper.s_user(params);
        SQLMap s_user_emt=s_user.getExistfirst();
        result.put("s_user", s_user_emt);
        
        
        int task_level=CommonUtil.parseInt(getParameter("task_level"),-1);
        SQLMap s_user_info=s_user.getExistfirst();
        
        
        params.put("task_begindate",getAfterWorkHour(getParameter("task_begindate"),task_level*3,s_user_info));
        params.put("task_endate",getAfterWorkHour(getParameter("task_begindate"),task_level*2,s_user_info));
        mapper.updatetime(params);
        
        return result;
    }
}